package com.example.administrator.liveapp.aliyun;

import android.app.Application;
import android.content.Context;
import android.widget.Toast;

import com.alivc.player.AliVcMediaPlayer;
import com.alivc.player.MediaPlayer;
import com.example.administrator.liveapp.MainActivity;

/**
 * 异常事件处理详解（备注：必须对异常进行处理)
 */

public class VideoErrorListener implements AliVcMediaPlayer.MediaPlayerErrorListener {
    @Override
    public void onError(int what, int extra) {
        switch(what)
        {
            case MediaPlayer.ALIVC_ERR_ILLEGALSTATUS:
                // 非法状态！
                break;
            case MediaPlayer.ALIVC_ERR_NO_NETWORK:
                //report_error("视频资源或网络不可用！", true);
                break;
            case MediaPlayer.ALIVC_ERR_INVALID_INPUTFILE:
                //视频资源或网络不可用
                break;
            case MediaPlayer.ALIVC_ERR_NO_SUPPORT_CODEC:
                //无支持的解码器!
                break;
            case MediaPlayer.ALIVC_ERR_FUNCTION_DENIED:
                //无此操作权限!
                break;
            case MediaPlayer.ALIVC_ERR_UNKNOWN:
                //未知错误!
                break;
            case MediaPlayer.ALIVC_ERR_NOTAUTH:
                //未鉴权!
                break;
            case MediaPlayer.ALIVC_ERR_READD:
                //资源访问失败!
                break;
            default:
                //播放器错误!
                break;
        }
    }
}
